Field of the Invention
One disclosed aspect of the embodiments relates to a motor control apparatus that controls a stepping motor, and to a motor control method and a program.
Description of the Related Art
A stepping motor is driven according to a pulse signal and rotated by an angle corresponding to the number of pluses of the pulse signal at a rotation speed corresponding to a frequency of the pulse signal. Thus, if the speed of the stepping motor is to be controlled, the frequency and the number of pulses of the pulse signal need to be controlled, and a pulse signal application time needs to be calculated based on an instructed speed.
For example, Japanese Patent Application Laid-Open No. 2001-119997 discusses changing a micro-step interval in micro-step drive every ¼ cycle of a drive current of a pulse motor when the pulse motor is accelerated or decelerated. This enhances a speed resolution at the time of acceleration or deceleration of a moving object, so that the moving object can smoothly accelerate and decelerate.
In a stepping motor, as illustrated in FIG. 8A, trapezoidal control for controlling speed with respect to time in a trapezoidal shape is performed. In the trapezoidal control, a rotation speed of the stepping motor is gradually increased or decreased while an acceleration rate is constant at the time of acceleration or deceleration of the stepping motor. As for the trapezoidal control, for example, Japanese Patent Application Laid-Open No. 7-163195 discusses a configuration in which pulse train generation timing is calculated according to a recurrence formula.
Moreover, as illustrated in FIG. 8B, S-shaped control is known as a method for preventing a change in acceleration rate in the trapezoidal control. The S-shaped control changes an acceleration rate in a trapezoidal shape at the time of acceleration and deceleration of a stepping motor.
Moreover, an acceleration and deceleration pulse generating apparatus using a pattern memory for storing acceleration and deceleration pattern data of various velocity curves has been proposed to change pulse signals into various acceleration and deceleration patterns. Such an acceleration and deceleration pulse generating apparatus successively reads the acceleration and deceleration pattern data stored in the pattern memory, and converts the acceleration and deceleration pattern data into serial data by using a parallel-serial conversion circuit to output the serial data as a pulse signal.
Moreover, Japanese Patent Application Laid-Open No. 2000-139099 proposes a method for controlling a change in acceleration rate. According to the method, a speed pattern including a plurality of straight lines is calculated using a simple recurrence formula, and an acceleration rate to be substituted into the recurrence formula is set to an acceleration rate of a next straight-line or an acceleration rate of a previous straight-line at an acceleration rate change point. This prevents a change in acceleration rate.
In a case where speed of a stepping motor is controlled, the speed control is ideally performed according to a calculation based on a physical theory expressing stepping motor behavior. However, a calculation such as a square root calculation and a cubic root calculation needs to be performed depending on a physical theoretical formula. This increases a circuit size and a processing time to solve the calculation.
On the other hand, if speed of the stepping motor is controlled according to an approximate calculation, there are advantages in terms of a circuit size and a processing time. However, depending on accuracy of the approximation calculation, a theoretical speed pattern may not be acquired or various speed patterns may not be dealt with, which may lead to some problems. For example, there is a case where a sudden change in an acceleration rate cannot be prevented in a suitable manner, and as a result, vibrations are generated. In some cases, an acceleration time or a deceleration time may need to be extended to prevent generation of vibration. Moreover, in a case where data such as acceleration and deceleration pattern data are stored in a memory, if an acceleration and deceleration period becomes longer, there is a problem in which capacity of a necessary memory is increased with an increase in the number of acceleration and deceleration patterns or enhancement of micro-step drive accuracy. Accordingly, there is a possibility that such speed control may not be suitable for a stepping motor to be used for, for example, a medical robot hand which employs a joystick to dynamically control the position and the speed thereof.